package io.demo.adaptors;

import io.demo.strategy.Duck;
import io.demo.strategy.FlyBehavior;

/**
 * @author create by zhangpengfei at 2021/9/30 09:54
 */

public class Main {
    public static void main(String[] args) {
        Turkey turkey = new WildTurkey();
        GobbleBehavior gobbleBehavior = new TurkeyGobble();
        FlyBehavior flyBehavior = new TurkeyFly();

        turkey.setFlyBehavior(flyBehavior);
        turkey.setGobbleBehavior(gobbleBehavior);

       // 适配器伪装
        Duck duck = new TurkeyAdapter(turkey);
        duck.performFly();
        duck.performQuack();
    }
}
